<template>
	<div class="container-404 ">
		<div class="content-404 cus-center">
			<div class="pic-404">
				<img alt="404" class="pic-404__parent" src="@/assets/image/404_images/404.png">
				<img alt="404" class="pic-404__child left" src="@/assets/image/404_images/404_cloud.png">
				<img alt="404" class="pic-404__child mid" src="@/assets/image/404_images/404_cloud.png">
				<img alt="404" class="pic-404__child right" src="@/assets/image/404_images/404_cloud.png">
			</div>
			<div class="bullshit">
				<div class="bullshit__oops">OOPS!</div>
				<div class="bullshit__headline">网页走丢了……</div>
				<div class="bullshit__info">
					{{
						`请检查路由${route.redirectedFrom ? `（${route.redirectedFrom.path}）` : ''}是否正确，或点击下方按钮回首页。`
					}}
				</div>
				<el-button class="bullshit__return-home" type="primary" @click="$router.push('/')">回首页</el-button>
			</div>
		</div>
	</div>
	<icp/>
</template>

<script lang="ts" name="Page404" setup>

import {useRoute} from 'vue-router'
import Icp from '@/components/icp.vue'

const route = useRoute()

</script>

<style lang="scss" scoped>
.container-404 {
	align-items: center;
	display: flex;
	justify-content: center;
	margin: 0;
	z-index: var(--cus-main-z-index);

	.content-404 {
		width: 100vw;
		height: 100vh;

		.pic-404 {
			max-width: 800px;
			min-width: 300px;
			position: relative;
			width: 40%;

			&__parent {
				width: 100%;
			}

			&__child {
				position: absolute;

				&.left {
					animation-delay: 1s;
					animation-duration: 2s;
					animation-fill-mode: forwards;
					animation-name: cloudLeft;
					animation-timing-function: linear;
					left: 220px;
					opacity: 0;
					top: 17px;
					width: 80px;
				}

				&.mid {
					animation-delay: 1.2s;
					animation-duration: 2s;
					animation-fill-mode: forwards;
					animation-name: cloudMid;
					animation-timing-function: linear;
					left: 420px;
					opacity: 0;
					top: 10px;
					width: 46px;
				}

				&.right {
					animation-delay: 1s;
					animation-duration: 2s;
					animation-fill-mode: forwards;
					animation-name: cloudRight;
					animation-timing-function: linear;
					left: 500px;
					opacity: 0;
					top: 100px;
					width: 62px;
				}

				@keyframes cloudLeft {
					0% {
						top: 17px;
						left: 220px;
						opacity: 0;
					}
					20% {
						top: 33px;
						left: 188px;
						opacity: 1;
					}
					80% {
						top: 81px;
						left: 92px;
						opacity: 1;
					}
					100% {
						top: 97px;
						left: 60px;
						opacity: 0;
					}
				}
				@keyframes cloudMid {
					0% {
						top: 10px;
						left: 420px;
						opacity: 0;
					}
					20% {
						top: 40px;
						left: 360px;
						opacity: 1;
					}
					70% {
						top: 130px;
						left: 180px;
						opacity: 1;
					}
					100% {
						top: 160px;
						left: 120px;
						opacity: 0;
					}
				}
				@keyframes cloudRight {
					0% {
						top: 100px;
						left: 500px;
						opacity: 0;
					}
					20% {
						top: 120px;
						left: 460px;
						opacity: 1;
					}
					80% {
						top: 180px;
						left: 340px;
						opacity: 1;
					}
					100% {
						top: 200px;
						left: 300px;
						opacity: 0;
					}
				}
			}
		}

		.bullshit {
			padding-left: 20px;

			&__oops {
				animation-duration: 0.5s;
				animation-fill-mode: forwards;
				animation-name: slideUp;
				color: var(--el-color-primary);
				font-size: 50px;
				font-weight: bold;
				margin-bottom: 20px;
				opacity: 0;
			}

			&__headline {
				animation-delay: 0.1s;
				animation-duration: 0.5s;
				animation-fill-mode: forwards;
				animation-name: slideUp;
				color: var(--el-color-white);
				font-size: 25px;
				font-weight: bold;
				margin-bottom: 10px;
				opacity: 0;
			}

			&__info {
				animation-delay: 0.2s;
				animation-duration: 0.5s;
				animation-fill-mode: forwards;
				animation-name: slideUp;
				color: var(--el-color-info);
				font-size: 12.5px;
				line-height: 10px;
				margin: 30px 0;
				opacity: 0;
			}

			&__return-home {
				animation-delay: 0.3s;
				animation-duration: 0.5s;
				animation-fill-mode: forwards;
				animation-name: slideUp;
				font-size: 15px;
				height: 35px;
			}

			@keyframes slideUp {
				0% {
					transform: translateY(60px);
					opacity: 0;
				}
				100% {
					transform: translateY(0);
					opacity: 1;
				}
			}
		}
	}
}
</style>
